<template>
    <div class="details-page">
        <Header></Header>
        <div class="content">
            <h3>{{this.detailsPageList.title}}</h3>
            <p>{{this.detailsPageList.created_at}}</p>
            <span></span>
            <div v-html="detailsPageList.body"></div>
        </div>
        <div class="fixeds" v-show="topShow" ref="viewBox">
            <a href="#">
                <img src="../../../static/img/back-top.png" alt="">
            </a>
        </div>
        <Interactive></Interactive>
    </div>
</template>
<script>
import Header from '../productVideo/components/Header'
import Interactive from '../interactive/Interactive'
export default {
    name: 'NewsDetailsPage',
    data(){
        return {
            detailsPageList: [],
            id: null,
            topShow: true
        }
    },
    created(){
        this.getId();
        this.axios.get('/articles/'+ this.id,{
            params: {
                id: this.id
            }
        })
        .then((res) => {
            this.detailsPageList = res.data.data;
            console.log(res.data.data);
        })
        .catch((error) => {
            console.log(error);
        })
    },
    methods: {
        getId(){
            this.id = this.$route.params.id;
        }
    },
    components: {
        Header,
        Interactive
    }
}
</script>
<style scoped>
.details-page{
    width: 100%;
    height: auto;
}
.details-page .content{
    width: 6.69rem;
    height: auto;
    margin-top: .4rem;
    margin-bottom: 1.5rem;
    margin-left: .42rem;
}
.details-page .content h3{
    font-size: 16px;
    color: #333;
    width: 100%;
    text-align: center;
    height: .4rem;
    overflow: hidden;
}
.details-page .content p{
    width: 100%;
    text-align: center;
    margin-top: .2rem;
    font-size: 12px;
    color: #ccc;
}
.details-page .content span{
    width: 100%;
    border-bottom: .02rem solid #e8e8e8;
    display: inline-block;
    margin-top: .2rem;
}
.details-page .content div{
    margin-top: .2rem;
    font-size: 14px;
}
.details-page .content div img{
    width: 100%;
    height: auto;
}
.details-page .fixeds{
    width: .7rem;
    height: .7rem;
    position: fixed;
    bottom: 2.5rem;
    right: .3rem;
}
.details-page .fixeds img{
    width: 100%;
    height: auto;
}
</style>
<style>
.details-page .content div img{
    width: 100%;
    height: auto;
}
</style>
